/**
 * Created by zhengqiang.liu on 2018/6/21.
 */
import { Menu, Icon, Avatar, Row, Col } from 'antd'
import Link from 'umi/link'
import styles from './index.css'

const MenuItemGroup = Menu.ItemGroup
const SubMenu = Menu.SubMenu

function Header ({location}) {
    return (
        <div style={{padding: '20px 0'}}>
            <Row gutter={16}>
                <Col span={6}>
                    <div className={styles.logo}/>
                </Col>
                <Col span={12}> <Menu
                    className={styles.anthorizontal}
                    selectedKeys={[location.pathname]}
                    mode="horizontal"
                >
                    <Menu.Item key="/">
                        <Link to="/"><Icon type="home"/>首页</Link>
                    </Menu.Item>
                    <SubMenu title={<span><Icon type="setting"/>营销活动</span>}>
                        <Menu.Item key="/setting:1">
                            <Link to="/activity"><Icon type="bars"/>创建活动</Link>
                        </Menu.Item>
                        <Menu.Item key="/setting:1">
                                <Link to="/activity"><Icon type="bars"/>营销方案搜索</Link>
                        </Menu.Item>
                        <Menu.Item key="/setting:1">
                            <Link to="/activity"><Icon type="bars"/>创建活动列表</Link>
                        </Menu.Item>
                        <Menu.Item key="/setting:1">
                            <Link to="/activity"><Icon type="bars"/>创建活动名称</Link>
                        </Menu.Item>
                    </SubMenu>
                    <Menu.Item key="/umi">
                        <Link to="/users">門店形象</Link>
                    </Menu.Item>
                    <Menu.Item key="/users1">
                        <Link to="/users">分析查詢</Link>
                    </Menu.Item>
                    <Menu.Item key="/users">
                        <Link to="/users"><Icon type="bars"/>我的订单</Link>
                    </Menu.Item>
                </Menu></Col>
                <Col span={6}> <Avatar style={{backgroundColor: '#87d068', float: 'right'}} icon="user"/>
                </Col>
            </Row>
        </div>
    )
}

export default Header